package o;

import android.app.Activity;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager.NameNotFoundException;
import androidx.annotation.DrawableRes;
import androidx.annotation.StringRes;
import com.huawei.fastengine.fastview.download.utils.PackageUtils;

public class dgm {
    private static int ʻ = 0;
    private static String ʻॱ = null;
    private static int ʼ = 0;
    private static int ʽ = -1;
    private static int ˊ = -1;
    private static int ˊॱ = 0;
    private static int ˋ = -1;
    private static String ˋॱ = null;
    private static int ˎ = -1;
    private static int ˏ = -1;
    private static int ˏॱ = 0;
    private static String ͺ = null;
    private static int ॱ = -1;
    private static String ॱˊ = null;
    private static String ॱˋ = null;
    private static int ॱˎ = 0;
    private static int ॱॱ = 0;
    private static int ॱᐝ = 0;
    private static String ᐝ = null;
    private static int ᐝॱ = 0;

    public static int ˎ() {
        return ˊ;
    }

    public static int ˊ() {
        return ˎ;
    }

    public static int ˏ() {
        return ˋ;
    }

    public static int ॱ() {
        return ॱ;
    }

    public static void ˋ(int i, Activity activity) {
        if (activity != null) {
            int taskId = activity.getTaskId();
            if (taskId == -1) {
                return;
            }
            if (i == 1) {
                ˎ = taskId;
            } else if (i == 17) {
                ˋ = taskId;
            } else if (i == 18) {
                ॱ = taskId;
            } else if (i == 4) {
                ˏ = taskId;
            } else if (i == 1000) {
                ʽ = taskId;
            } else {
                ˊ = taskId;
            }
        }
    }

    public static void ˋ(int i, Activity activity, int i2, String str) {
        if (activity != null) {
            int taskId = activity.getTaskId();
            if (taskId == -1) {
                return;
            }
            if (i == 1) {
                ˎ = taskId;
            } else if (i == 17) {
                ˋ = taskId;
                ʻ = i2;
                ᐝ = str;
            } else if (i == 18) {
                ॱ = taskId;
                ॱॱ = i2;
                ˋॱ = str;
            } else if (i == 4) {
                ˏ = taskId;
            } else if (i == 1000) {
                ʽ = taskId;
                ʻ = i2;
                ᐝ = str;
            } else {
                ˊ = taskId;
                ʼ = i2;
            }
        }
    }

    public static String ॱ(Activity activity) {
        int i = 0;
        if (activity == null) {
            return null;
        }
        int taskId = activity.getTaskId();
        if (taskId == -1 || ˊ == taskId) {
            i = ʼ;
        } else if (ˋ == taskId || ʽ == taskId) {
            i = ʻ;
        } else if (ॱ == taskId) {
            i = ॱॱ;
        }
        if (i == 0) {
            i = ʼ;
        }
        return activity.getString(i);
    }

    public static String ˊ(Activity activity) {
        if (activity == null) {
            return null;
        }
        int taskId = activity.getTaskId();
        if (taskId == -1) {
            return null;
        }
        if (ˋ == taskId || ʽ == taskId) {
            return ᐝ;
        }
        if (ॱ == taskId) {
            return ˋॱ;
        }
        return null;
    }

    public static int ˎ(Activity activity) {
        if (activity != null) {
            int taskId = activity.getTaskId();
            if (taskId == -1 || ˊ == taskId) {
                return ccz.ॱ();
            }
            if (ˎ == taskId) {
                return 1;
            }
            if (ˋ == taskId || ʽ == taskId) {
                return 17;
            }
            if (ॱ == taskId) {
                return 18;
            }
            if (ˏ == taskId) {
                return 4;
            }
        }
        return ccz.ॱ();
    }

    public static void setEnd(int i) {
        if (i == 1) {
            ˎ = -1;
        } else if (i == 17) {
            ˋ = -1;
        } else if (i == 18) {
            ॱ = -1;
        } else if (i == 4) {
            ˏ = -1;
        } else {
            ˊ = -1;
        }
    }

    public static boolean ˋ() {
        return ˊ != -1;
    }

    public static boolean ˏ(Activity activity) {
        return ˎ(activity) == 1;
    }

    public static boolean isGameVSupport() {
        try {
            PackageInfo packageInfo = ContentManager.getInstant().getContext().getPackageManager().getPackageInfo(PackageUtils.HWGAMEBOX_PACKAGE_NAME, 0);
            if (packageInfo == null || packageInfo.versionCode < 2200) {
                return false;
            }
            return true;
        } catch (NameNotFoundException e) {
            return false;
        }
    }

    public static boolean ˋ(int i) {
        if (i == 1 || i == 17 || i == 18) {
            return true;
        }
        return false;
    }

    public static void ˏ(int i, @StringRes int i2, @DrawableRes int i3, String str) {
        if (i == 5) {
            ॱˎ = i2;
            ॱᐝ = i3;
            ॱˋ = str;
        } else if (i == 17) {
            ʻ = i2;
            ˏॱ = i3;
            ͺ = str;
        } else if (i == 18) {
            ॱॱ = i2;
            ˊॱ = i3;
            ॱˊ = str;
        } else if (i == 0) {
            ʼ = i2;
            ᐝॱ = i3;
            ʻॱ = str;
        }
    }

    public static int ॱ(int i) {
        if (i == 5) {
            return ॱˎ;
        }
        if (i == 17) {
            return ʻ;
        }
        if (i == 18) {
            return ॱॱ;
        }
        return ʼ;
    }

    public static int ˊ(int i) {
        if (i == 5) {
            return ॱᐝ;
        }
        if (i == 17) {
            return ˏॱ;
        }
        if (i == 18) {
            return ˊॱ;
        }
        return ᐝॱ;
    }

    public static String ˎ(int i) {
        if (i == 5) {
            return ॱˋ;
        }
        if (i == 17) {
            return ͺ;
        }
        if (i == 18) {
            return ॱˊ;
        }
        return ʻॱ;
    }
}
